package com.sdonkey.score.dto.register;


/**
 * 注册表单页面封装
 *
 * @author ZhaoShihao
 * @version 1.0
 */
public class RegisterPageAdInfo {

    private int id;

    private String adCategory;//广告需求类别
    private String hobby;//兴趣爱好
    private String adKey;//关键字

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getAdCategory() {
        return adCategory;
    }

    public void setAdCategory(String[] adCategory) {
        this.adCategory = converToString(adCategory);
    }

    public void setAdCategory(String adCategory) {
        this.adCategory = adCategory;
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String[] hobby) {
        this.hobby = converToString(hobby);
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }

    public String getAdKey() {
        return adKey;
    }

    public void setAdKey(String[] adKey) {
        this.adKey = converToString(adKey);
    }

    public void setAdKey(String adKey) {
        this.adKey = adKey;
    }

    public String converToString(String[] ig) {
        StringBuilder str = new StringBuilder();
        String s = null;
        if (ig != null && ig.length > 0) {
            int i = ig.length > 5 ? 5 : ig.length;
            for (int j = 0; j < i; j++) {
                str.append(ig[j]).append("|");
            }
            s = str.substring(0, str.length() - 1);
        }
        return s;
    }
}
